]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: don't react to window drags
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 19 Feb 2013 03:34:27 +0000 (22:34 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 19 Feb 2013 03:50:11 +0000 (22:50 -0500)
Instead, make the actor half-opaque in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=686984

js/ui/dash.js
js/ui/overviewControls.js

index 0d919afbcb3274863184795529bd5247bd3a0581..c1385b9be2c66d7cac9218a17e0716e91268b618 100644 (file)
@@ -24,9 +24,6 @@ const DASH_ITEM_HOVER_TIMEOUT = 300;
 function getAppFromSource(source) {
     if (source instanceof AppDisplay.AppWellIcon) {
         return source.app;
-    } else if (source.metaWindow) {
-        let tracker = Shell.WindowTracker.get_default();
-        return tracker.get_window_app(source.metaWindow);
     } else {
         return null;
     }
@@ -415,12 +412,6 @@ const Dash = new Lang.Class({
                               Lang.bind(this, this._onDragEnd));
         Main.overview.connect('item-drag-cancelled',
                               Lang.bind(this, this._onDragCancelled));
-        Main.overview.connect('window-drag-begin',
-                              Lang.bind(this, this._onDragBegin));
-        Main.overview.connect('window-drag-cancelled',
-                              Lang.bind(this, this._onDragCancelled));
-        Main.overview.connect('window-drag-end',
-                              Lang.bind(this, this._onDragEnd));
 
         // Translators: this is the name of the dock/favorites area on
         // the left of the overview
index df4d637af3989710da740a229ca7c32c50361899..42e26a1f3dd5386ea925fe5f95ff5edf854a5013 100644 (file)
@@ -101,9 +101,10 @@ const SlidingControl = new Lang.Class({
         Main.overview.connect('item-drag-begin', Lang.bind(this, this._onDragBegin));
         Main.overview.connect('item-drag-end', Lang.bind(this, this._onDragEnd));
         Main.overview.connect('item-drag-cancelled', Lang.bind(this, this._onDragEnd));
-        Main.overview.connect('window-drag-begin', Lang.bind(this, this._onDragBegin));
-        Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onDragEnd));
-        Main.overview.connect('window-drag-end', Lang.bind(this, this._onDragEnd));
+
+        Main.overview.connect('window-drag-begin', Lang.bind(this, this._onWindowDragBegin));
+        Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onWindowDragEnd));
+        Main.overview.connect('window-drag-end', Lang.bind(this, this._onWindowDragEnd));
     },
 
     getSlide: function() {
@@ -162,6 +163,14 @@ const SlidingControl = new Lang.Class({
         this.actor.translation_x = 0;
     },
 
+    _onWindowDragBegin: function() {
+        this._onDragBegin();
+    },
+
+    _onWindowDragEnd: function() {
+        this._onDragEnd();
+    },
+
     _onDragBegin: function() {
         this.inDrag = true;
         this.actor.translation_x = 0;
@@ -173,6 +182,20 @@ const SlidingControl = new Lang.Class({
         this.updateSlide();
     },
 
+    fadeIn: function() {
+        Tweener.addTween(this.actor, { opacity: 255,
+                                       time: SIDE_CONTROLS_ANIMATION_TIME / 2,
+                                       transition: 'easeInQuad'
+                                     });
+    },
+
+    fadeHalf: function() {
+        Tweener.addTween(this.actor, { opacity: 128,
+                                       time: SIDE_CONTROLS_ANIMATION_TIME / 2,
+                                       transition: 'easeOutQuad'
+                                     });
+    },
+
     slideIn: function() {
         this.visible = true;
         // we will update slideX and the translation from pageEmpty
@@ -294,6 +317,14 @@ const DashSlider = new Lang.Class({
             return 1;
         else
             return 0;
+    },
+
+    _onWindowDragBegin: function() {
+        this.fadeHalf();
+    },
+
+    _onWindowDragEnd: function() {
+        this.fadeIn();
     }
 });